//
//  FirstModel.m
//  __PRODUCTNAME__
//
//  Created by dllo on 16/08/17
//  Copyright (c) yh. All rights reserved.
//

#import "FirstModel.h"
#import "DataModel.h"

@implementation FirstModel

+ (NSDictionary *)objectClassInArray{
    return @{@"data" : [DataModel class]};
}

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"data"]) {
        NSMutableArray<DataModel *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            DataModel *data = [DataModel modelWithDic:dic];
            [array addObject:data];
        }
        _data = array;
    }
}

@end
